package com.sinosoft.brokerchannel.base.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.sinosoft.brokerchannel.base.bins.Channel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@ApiModel()
@Data
public abstract class AbstractRequestMain {
    /**
     * 渠道信息
     */
    @ApiModelProperty(value = "渠道信息",//说明
            name = "Channel", //重命名
            dataType = "类",//类型
            required = true //是否必传,默认false
            //是否允许空值
    )
    @JsonProperty(value = "Channel")
    private Channel channel;
    // add by yangwentao reason:RM-3612 渠道平台新增时间戳日志-渠道平台  评审人:李振民 评审日期:2018-01-03 date：2017-12-28 begin
    /**
     * 耗时
     */
    private Map<Object, Object> map = new HashMap<Object, Object>();

    public Map<Object, Object> getMap() {
        if (map != null && map.get("uuid") == null) {
            UUID uuid = UUID.randomUUID();
            map.put("uuid", uuid.toString());
        }
        return map;
    }
}
